summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockGlowstone.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Blocks/BlockGlowstone.h')
-rw-r--r--src/Blocks/BlockGlowstone.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Blocks/BlockGlowstone.h b/src/Blocks/BlockGlowstone.h
index 930509e0a..11aa5e379 100644
--- a/src/Blocks/BlockGlowstone.h
+++ b/src/Blocks/BlockGlowstone.h
@@ -6,6 +6,7 @@
+
class cBlockGlowstoneHandler :
public cBlockHandler
{
@@ -22,13 +23,14 @@ private:
{
return cItem(E_BLOCK_GLOWSTONE, 1, 0);
}
- else
- {
- unsigned int DropNum = GetRandomProvider().RandInt<char>(2, 4 + ToolFortuneLevel(a_Tool));
- // cap the dropnum to the max amount of 4
- DropNum = std::min<unsigned int>(DropNum, 4);
- return cItem(E_ITEM_GLOWSTONE_DUST, DropNum, 0);
- }
+
+ // Number of dust to drop, capped at the max amount of 4.
+ const auto Drops = std::min(
+ static_cast<char>(4),
+ GetRandomProvider().RandInt<char>(2, 4 + ToolFortuneLevel(a_Tool))
+ );
+
+ return cItem(E_ITEM_GLOWSTONE_DUST, Drops);
}